package com.bmps.springcloud.insuredmicroservice.model.cancel;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.bmps.springcloud.insuredmicroservice.model.accept.response.ResponseHeaderModel;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;

/**
 * description:
 * 撤件响应
 *
 * @author jackdaw
 * @date 2019-11-27 11:42
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"header", "response"})
public class CancelResponseModel implements Serializable {
    private static final long serialVersionUID = 612806065025329280L;
    @XStreamAlias("Header")
    private ResponseHeaderModel header;
    @XStreamAlias("Response")
    private ResultListModel response;

    public ResponseHeaderModel getHeader() {
        return header;
    }

    public void setHeader(ResponseHeaderModel header) {
        this.header = header;
    }

    public ResultListModel getResponse() {
        return response;
    }

    public void setResponse(ResultListModel response) {
        this.response = response;
    }

    @Override
    public String toString() {
        return "CancelResponseModel{" +
                "header=" + header +
                ", response=" + response +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (!(o instanceof CancelResponseModel)) {
            return false;
        }

        CancelResponseModel that = (CancelResponseModel) o;

        return new EqualsBuilder()
                .append(header, that.header)
                .append(response, that.response)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(header)
                .append(response)
                .toHashCode();
    }
}
